<%@page import="java.util.Date"
%><%@page import="itpenguin.entities.Series"
%><%@page import="itpenguin.entities.Article"
%><%@page import="java.util.List"
%><%@page import="itpenguin.common.PMFactory"
%><%@page import="javax.jdo.PersistenceManager"
%><%@page import="javax.jdo.Query"
%><%@page import="itpenguin.common.Util"
%><%@ page language="java" contentType="text/xml; charset=UTF-8" pageEncoding="UTF-8"
%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" 
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" 
%><?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<%
	PersistenceManager pm = PMFactory.getInstance().getPersistenceManager();
	Query query = pm.newQuery("select from itpenguin.entities.Series order by published desc");  
	List<Series> seriesList = (List<Series>) query.execute();
	pageContext.setAttribute("seriesList", seriesList);
	pageContext.setAttribute("prefix", "http://www.it-penguin.com");
	pageContext.setAttribute("now", new Date());
%>
   <url>
      <loc>http://www.it-penguin.com/</loc>
      <lastmod><fmt:formatDate value="${now}" pattern="yyyy/MM/dd" />T<fmt:formatDate value="${now}" pattern="HH:mm:ss" timeZone="JST" />+09:00</lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.7</priority>
   </url>
	<c:forEach items="${seriesList}" var="content">
	   <url>
	      <loc>${prefix}/${content.contextName}/${content.id}</loc>
	      <lastmod><fmt:formatDate value="${content.published}" pattern="yyyy-MM-dd" />T<fmt:formatDate value="${content.published}" pattern="HH:mm:ss" timeZone="JST" />+09:00</lastmod>
	      <changefreq>weekly</changefreq>
	      <priority>0.7</priority>
	   </url>
	</c:forEach>
<%
	query = pm.newQuery("select from itpenguin.entities.Article order by published desc");  
	List<Article> articleList = (List<Article>) query.execute();
	pageContext.setAttribute("articleList", articleList);
%>
	<c:forEach items="${articleList}" var="content">
	   <url>
	      <loc>${prefix}/${content.contextName}/${content.id}</loc>
	      <lastmod><fmt:formatDate value="${content.published}" pattern="yyyy-MM-dd" />T<fmt:formatDate value="${content.published}" pattern="HH:mm:ss" timeZone="JST" />+09:00</lastmod>
	      <changefreq>weekly</changefreq>
	      <priority>0.5</priority>
	   </url>
	</c:forEach>
</urlset>